//
//  SwiftUIView.swift
//  JuSwift
//
//  Created by Juvid on 2020/10/13.
//  Copyright © 2020 Juvid. All rights reserved.
//

import SwiftUI

struct SwiftUIView: View {
    var body: some View {
        TabView {
                    List(0 ..< 100) { item in
                           LandmarkRow()
                      }.tabItem {
                              Image(systemName: "1.square.fill")
                              Text("First")
                          }
            NavigationView {
                NavigationLink(destination: /*@START_MENU_TOKEN@*/ /*@PLACEHOLDER=Destination@*/Text("Destination")/*@END_MENU_TOKEN@*/) {  LandmarkRow() }
            }.tabItem {
                              Image(systemName: "2.square.fill")
                              Text("Second")
                          }

            Text("The Last Tab")
                .tabItem {
                        Image(systemName: "3.square.fill")
                        Text("Third")
                    }
            }.font(.headline)
    }
}

struct LandmarkRow : View {
    var body: some View {
        HStack {
            VStack{
                Image("test1")
                    .frame(width: 60.0, height: 60.0).clipped()
            }
            VStack {
                Text("Hello,SwiftUI").fontWeight(.medium).foregroundColor(Color.red).lineLimit(nil).padding(.leading, 5).padding(.top, 15.0)
                ExtractedView()
            }

            Text("Hello,SwiftUI2")
        }
    }
}

struct ExtractedView: View {
    var body: some View {
        ForEach(0 ..< 2) { item in
            Text("Hello,VStack")
        }
    }
}

struct SwiftUIView_Previews: PreviewProvider {
    static var previews: some View {
        SwiftUIView()
    }
}
